package com.fairytask.logic
{
	import com.fairytask.data.Modulator;
	import com.fairytask.event.BattleEvent;
	import com.fairytask.screen.BattleScreen;

	/**
	 *  战斗逻辑 
	 * @author game
	 * 
	 */	
	public class BattleLogic
	{
		private static var _instance	:BattleLogic;
		private var model		:Modulator;
		private var battleScene:BattleScreen;
		
		public function BattleLogic()
		{
			model	=	Modulator.instance;
			battleScene	=	BattleScreen.instance;
			initEvent();
		}
		
		public static function get instance():BattleLogic
		{
			if(null==_instance)
			{
				_instance	=	new BattleLogic();
			}
			return _instance;
		}
		
		/**
		 * 定义战斗事件 
		 */
		private function initEvent():void
		{
			model.addEventListener(BattleEvent.ENTER_BATTLE,onEnterBattle);
		}
		
		/**
		 * 进入战斗 
		 * @param evt
		 * 
		 */
		private function onEnterBattle(evt:BattleEvent):void
		{
			battleScene.showBattle(0,100001);
		}
		
	}
}